package com.siyu.tickets.entity;

import com.siyu.tickets.entity.base.BaseSysUser;

public class SysUser extends BaseSysUser {

	private static final long serialVersionUID = 1L;

	/* [CONSTRUCTOR MARKER BEGIN] */
	public SysUser() {
		super();
	}

	/**
	 * Constructor for primary key
	 */
	public SysUser(java.lang.Integer id) {
		super(id);
	}

	/**
	 * Constructor for required fields
	 */
	public SysUser(java.lang.Integer id, java.lang.String username, java.lang.String password, java.util.Date createTime) {

		super(id, username, password, createTime);
	}

	/* [CONSTRUCTOR MARKER END] */

	public enum USER_TYPE {
		SUPPLIER, PARTNER, ADMIN
	}

	public USER_TYPE getUserType() {
		if (getPartner() != null) {
			return USER_TYPE.PARTNER;
		} else if (getSupplier() != null) {
			return USER_TYPE.SUPPLIER;
		} else if (getAdmin() != null) {
			return USER_TYPE.ADMIN;
		} else {
			return null;
		}
	}

}
